/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package researchgrants.parts.LoggedData;

/**
 *
 * @author DOStudent1
 */
public class LogableBoolean implements LogableObject {
    
    private Boolean value=null;
    private boolean isSet=false;
    
    public LogableBoolean() {
    }
    
    public LogableBoolean fromBoolean(Boolean bool) {
        LogableBoolean res=new LogableBoolean();
        res.value=bool;
        res.isSet=true;
        return(res);
    }

    
    public boolean isSet() {
        return(isSet);
    }
    
    
    
    public Boolean getBoolean() {
        if (!isSet) {
            throw new RuntimeException("Not initialized");
        }
        return(value);
    }

    public LoggedLogableObject toLoggedMyObject() {
        LoggedLogableBoolean loggedMyBoolean=new LoggedLogableBoolean();
        return(loggedMyBoolean.fromLogableObject(this));
    }

    public boolean isEmpty() {
        return(value==null);
    }

}
